[bits 32]
section .text

global _outb
_outb:
    push ebp
    mov ebp,esp
    mov dx,[ebp + 8]
    mov al,[ebp + 12]
    out dx,al
    nop ; 给硬件反应的时间
    nop
    nop
    leave
    ret

global _outw
_outw:
    push ebp
    mov ebp,esp
    mov dx,[ebp + 8]
    mov ax,[ebp + 12]
    out dx,ax
    nop
    nop
    nop
    leave
    ret

global _inb
_inb:
    push ebp
    mov ebp,esp
    mov dx,[ebp + 8]
    in al,dx
    nop
    nop
    nop
    leave
    ret

global _inw
_inw:
    push ebp
    mov ebp,esp
    mov dx,[ebp + 8]
    in ax,dx
    nop
    nop
    nop
    leave
    ret